package asapIs134CK.womi.client.games.logoGame.froggitTheFrog;

import asapIs134CK.womi.client.games.ThumbnailWidget;
import asapIs134CK.womi.client.imgs.logoGame.LogoGameImageBundle;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.VerticalPanel;

public class FroggitThumbnail extends ThumbnailWidget {

	private Panel _container;
	private Label _name;
	private Image _thumbnailImg;
	
	private static LogoGameImageBundle imgProvider = 
		(LogoGameImageBundle) GWT.create(LogoGameImageBundle.class);

	public FroggitThumbnail(FroggitWorld world){
		_container = new VerticalPanel();
		_container.addStyleName("froggitTF_bthumbnail");
		_name = new Label(world.getName());
		_thumbnailImg = new Image(imgProvider.froggit_logo());
		_container.add(_thumbnailImg);
		_container.add(_name);
		initWidget(_container);
	}

	@Override
	public void addClickHandler(ClickHandler clickhandler) {
		_thumbnailImg.addClickHandler(clickhandler);
		_name.addClickHandler(clickhandler);
	}
}
